package com.github.kotvertolet.youtubejextractor.models.newModels;

import com.google.gson.annotations.SerializedName;
import ohos.utils.Parcel;
import ohos.utils.Sequenceable;

import java.io.Serializable;

/**
 * 类功能描述(类上)
 *
 * @author AnBetter
 * @since 2021-04-16
 */
public class ErrorScreen implements Sequenceable, Serializable {
    @SerializedName("playabilityStatus")
    private PlayabilityStatus playabilityStatus;

    @SerializedName("playerErrorMessageRenderer")
    private PlayerErrorMessageRenderer playerErrorMessageRenderer;

    public static final Sequenceable.Producer<ErrorScreen> CREATOR = new Producer<ErrorScreen>() {
        @Override
        public ErrorScreen createFromParcel(Parcel parcel) {
            // Initialize an instance first, then do customized unmarshlling.
            ErrorScreen errorScreen = new ErrorScreen();
            errorScreen.unmarshalling(parcel);
            return errorScreen;
        }
    };

    @Override
    public boolean marshalling(Parcel parcel) {
        parcel.writeSequenceable(this.playabilityStatus);
        parcel.writeSequenceable(this.playerErrorMessageRenderer);
        return true;
    }

    @Override
    public boolean unmarshalling(Parcel parcel) {
        parcel.readSequenceable(this.playabilityStatus);
        parcel.readSequenceable(this.playerErrorMessageRenderer);
        return true;
    }

    @Override
    public String toString() {
        return "ErrorScreen{" +
                "playabilityStatus = '" + playabilityStatus + '\'' +
                ",playerErrorMessageRenderer = '" + playerErrorMessageRenderer + '\'' +
                "}";
    }

    public PlayabilityStatus getPlayabilityStatus() {
        return playabilityStatus;
    }

    public void setPlayabilityStatus(PlayabilityStatus playabilityStatus) {
        this.playabilityStatus = playabilityStatus;
    }

    public PlayerErrorMessageRenderer getPlayerErrorMessageRenderer() {
        return playerErrorMessageRenderer;
    }

    public void setPlayerErrorMessageRenderer(PlayerErrorMessageRenderer playerErrorMessageRenderer) {
        this.playerErrorMessageRenderer = playerErrorMessageRenderer;
    }
}
